package cn.highedu;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ApplicationContext;
import org.springframework.jdbc.core.JdbcTemplate;

import javax.sql.DataSource;
@SpringBootApplication
// @SpringBootApplication(exclude = DataSourceAutoConfiguration.class) // 排除自动配置数据源
public class Demo02Application {

    public static void main(String[] args) {
        ApplicationContext context =
            SpringApplication.run(Demo02Application.class, args);

        JdbcTemplate jdbcTemplate = context.getBean(JdbcTemplate.class);
        System.out.println(jdbcTemplate);

        DataSource dataSource = context.getBean(DataSource.class);
        System.out.println(dataSource);
    }

}
